{
  description = "NixOS configuration";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
    utils.url = "github:numtide/flake-utils";
  };

  outputs =
    flakeInputs:
    let
      flakeOutputs = flakeInputs.self.outputs;
      hosts."laptain".system = "x86_64-linux";
    in
    {
      nixosModules.default = import ./modules;
      nixosConfigurations = builtins.mapAttrs (
        hostName: hostSpec:
        flakeInputs.nixpkgs.lib.nixosSystem {
          inherit (hostSpec) system;
          specialArgs = {
            inherit flakeInputs flakeOutputs hostName;
          };
          modules = [
            ./configurations/${hostName}
          ];
        }
      ) hosts;
    }
    // flakeInputs.utils.lib.eachDefaultSystem (
      system:
      let
        pkgs = flakeInputs.nixpkgs.legacyPackages.${system};
        inherit (pkgs) lib;
      in
      {
        packages = lib.packagesFromDirectoryRecursive {
          inherit (pkgs) callPackage;
          directory = ./packages;
        };
      }
    );
}
